<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aifes_math.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('aifes__math_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">aifes_math.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="aifes__math_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef AIFES_MATH</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#define AIFES_MATH</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;math.h&gt;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;aifes_config.h&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaimath__dtype.html">aimath_dtype</a> <a class="code" href="structaimath__dtype.html">aimath_dtype_t</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaitensor.html">aitensor</a>     <a class="code" href="structaitensor.html">aitensor_t</a>;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structaimath__dtype.html">   44</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaimath__dtype.html">aimath_dtype</a> {</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structaimath__dtype.html#a8f8f80d37794cde9472343e4487ba3eb">   45</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structaimath__dtype.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>; </div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structaimath__dtype.html#ab2c6b258f02add8fdf4cfc7c371dd772">   46</a></span>&#160;    uint32_t <a class="code" href="structaimath__dtype.html#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structaimath__dtype.html#a05bb6981d499d285a533edfc40bab941">   47</a></span>&#160;    uint32_t <a class="code" href="structaimath__dtype.html#a05bb6981d499d285a533edfc40bab941">tensor_params_size</a>; </div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="structaimath__dtype.html#a31255ef6a6f99a7fbe3685dec7f29218">   55</a></span>&#160;    void (*<a class="code" href="structaimath__dtype.html#a31255ef6a6f99a7fbe3685dec7f29218">print_aitensor</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *tensor);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structaimath__dtype.html#a08e786bc3ccde258981cff5b20988a51">   64</a></span>&#160;    void (*<a class="code" href="structaimath__dtype.html#a08e786bc3ccde258981cff5b20988a51">print_aiscalar</a>)(<span class="keyword">const</span> <span class="keywordtype">void</span> *scalar);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;};</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="structaitensor.html">   89</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaitensor.html">aitensor</a> {</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="structaitensor.html#abf7a461af7296a09d5246ca13591b988">   90</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="structaimath__dtype.html">aimath_dtype_t</a> *<a class="code" href="structaitensor.html#abf7a461af7296a09d5246ca13591b988">dtype</a>; </div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structaitensor.html#acd6b0c9d182822b4646f744da608eb78">   91</a></span>&#160;    uint8_t <a class="code" href="structaitensor.html#acd6b0c9d182822b4646f744da608eb78">dim</a>; </div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="structaitensor.html#a2c6232867935ce2511be6f94dd8bab6b">   92</a></span>&#160;    uint16_t *<a class="code" href="structaitensor.html#a2c6232867935ce2511be6f94dd8bab6b">shape</a>; </div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="structaitensor.html#ab615dd1ddcc27064097dd98cbc7fe9a0">   93</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structaitensor.html#ab615dd1ddcc27064097dd98cbc7fe9a0">tensor_params</a>; </div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="structaitensor.html#a735984d41155bc1032e09bece8f8d66d">   94</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structaitensor.html#a735984d41155bc1032e09bece8f8d66d">data</a>; </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;};</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AIFES_MATH</span></div>
<div class="ttc" id="astructaimath__dtype_html"><div class="ttname"><a href="structaimath__dtype.html">aimath_dtype</a></div><div class="ttdoc">Indicator for the used datatype.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:44</div></div>
<div class="ttc" id="astructaimath__dtype_html_a05bb6981d499d285a533edfc40bab941"><div class="ttname"><a href="structaimath__dtype.html#a05bb6981d499d285a533edfc40bab941">aimath_dtype::tensor_params_size</a></div><div class="ttdeci">uint32_t tensor_params_size</div><div class="ttdoc">Size of the tensor params (for example for quantization parameters) of this type in bytes.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:47</div></div>
<div class="ttc" id="astructaimath__dtype_html_a08e786bc3ccde258981cff5b20988a51"><div class="ttname"><a href="structaimath__dtype.html#a08e786bc3ccde258981cff5b20988a51">aimath_dtype::print_aiscalar</a></div><div class="ttdeci">void(* print_aiscalar)(const void *scalar)</div><div class="ttdoc">Set a function to print the given scalar for debugging purposes.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:64</div></div>
<div class="ttc" id="astructaimath__dtype_html_a31255ef6a6f99a7fbe3685dec7f29218"><div class="ttname"><a href="structaimath__dtype.html#a31255ef6a6f99a7fbe3685dec7f29218">aimath_dtype::print_aitensor</a></div><div class="ttdeci">void(* print_aitensor)(const aitensor_t *tensor)</div><div class="ttdoc">Set a function to print the given tensor for debugging purposes.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:55</div></div>
<div class="ttc" id="astructaimath__dtype_html_a8f8f80d37794cde9472343e4487ba3eb"><div class="ttname"><a href="structaimath__dtype.html#a8f8f80d37794cde9472343e4487ba3eb">aimath_dtype::name</a></div><div class="ttdeci">const char * name</div><div class="ttdoc">Name of the data type (for example &quot;F32&quot;)</div><div class="ttdef"><b>Definition:</b> aifes_math.h:45</div></div>
<div class="ttc" id="astructaimath__dtype_html_ab2c6b258f02add8fdf4cfc7c371dd772"><div class="ttname"><a href="structaimath__dtype.html#ab2c6b258f02add8fdf4cfc7c371dd772">aimath_dtype::size</a></div><div class="ttdeci">uint32_t size</div><div class="ttdoc">The size of one data value of this type in bytes.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:46</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
<div class="ttc" id="astructaitensor_html_a2c6232867935ce2511be6f94dd8bab6b"><div class="ttname"><a href="structaitensor.html#a2c6232867935ce2511be6f94dd8bab6b">aitensor::shape</a></div><div class="ttdeci">uint16_t * shape</div><div class="ttdoc">An array of dim elements with the shape of the tensor for example [2, 3].</div><div class="ttdef"><b>Definition:</b> aifes_math.h:92</div></div>
<div class="ttc" id="astructaitensor_html_a735984d41155bc1032e09bece8f8d66d"><div class="ttname"><a href="structaitensor.html#a735984d41155bc1032e09bece8f8d66d">aitensor::data</a></div><div class="ttdeci">void * data</div><div class="ttdoc">Pointer to the actual tensor data.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:94</div></div>
<div class="ttc" id="astructaitensor_html_ab615dd1ddcc27064097dd98cbc7fe9a0"><div class="ttname"><a href="structaitensor.html#ab615dd1ddcc27064097dd98cbc7fe9a0">aitensor::tensor_params</a></div><div class="ttdeci">void * tensor_params</div><div class="ttdoc">Parameters to describe some data properties (for example quantization parameters like zero_point and ...</div><div class="ttdef"><b>Definition:</b> aifes_math.h:93</div></div>
<div class="ttc" id="astructaitensor_html_abf7a461af7296a09d5246ca13591b988"><div class="ttname"><a href="structaitensor.html#abf7a461af7296a09d5246ca13591b988">aitensor::dtype</a></div><div class="ttdeci">const aimath_dtype_t * dtype</div><div class="ttdoc">The datatype of the tensor, e.g.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:90</div></div>
<div class="ttc" id="astructaitensor_html_acd6b0c9d182822b4646f744da608eb78"><div class="ttname"><a href="structaitensor.html#acd6b0c9d182822b4646f744da608eb78">aitensor::dim</a></div><div class="ttdeci">uint8_t dim</div><div class="ttdoc">The number of dimensions.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:91</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_3d69f64eaf81436fe2b22361382717e5.html">core</a></li><li class="navelem"><a class="el" href="aifes__math_8h.html">aifes_math.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
